﻿/*
 * Erstellt mit SharpDevelop.
 * Benutzer: al
 * Datum: 11.03.2011
 * Zeit: 10:37
 * 
 * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
 */
using System;
using System.Collections.Generic;

namespace ThatsMeSDK
{
	/// <summary>
	/// Description of MemberBase.
	/// </summary>
	public abstract class MemberBase : IMember
	{
		public MemberBase()
		{
		}
		
		private int? id;
		private DateTime birthday;
		private Canton.CantonShortName? canton;
		private Gender? sex;
		private Uri profilePictrueUri;
		private Uri profileUri;
		private string realName;
		private string description;
		
		public int? Id {get{if(id == null)LoadMyUser(); return id;}set{id = value;}}

        public string Nick { get; set; }

        public DateTime Birthday {get{if(birthday == null)LoadMyUser(); return birthday;}set{birthday = value;}}

        public Canton.CantonShortName? Canton {get{if(canton == null)LoadMyUser(); return canton;}set{canton = value;}}
        
        public Gender? Sex {get{if(sex == null)LoadMyUser(); return sex;}set{sex = value;}}
        
        public Uri ProfilePictureUri {get{if(profilePictrueUri == null)LoadMyUser(); return profilePictrueUri;}set{profilePictrueUri = value;}}
        
        public Uri ProfileUri {get{if(profileUri == null)LoadMyUser(); return profileUri;}set{profileUri = value;}}

        public string RealName {get{if(realName == null)LoadMyUser(); return realName;}set{realName = value;}}
        public List<Member> Friends { get; set; }

        private List<GalleryPicture> gallery;
        public List<GalleryPicture> Gallery
        {
            get
            {
                if (gallery == null)
#warning Function not async!
                    gallery = null; //Core.ServiceHandler.GetUserPics(Nick);
                return gallery;
            }
            set { gallery = value; }
        }

        public string Description {get{if(description == null)LoadMyUser(); return description;}set{description = value;}}

        private List<GalleryCategory> categories;
        public List<GalleryCategory> Categories
        {
            get
            {
                if (categories == null)
#warning Function not async!
                    categories = null; //Core.ServiceHandler.GetUserPicCategories(Nick);
                return categories;
            }
            set { categories = value; }
        }

		
		public Member LoadMemberByID(int id)
        {
#warning Member returns null! Please make it asynchron
            return null; //Core.ServiceHandler.GetMemberById(id);
		}
		
		public Member LoadMemberByNick(string nick)
        {
#warning Member returns null! Please make it asynchron
            return null; //Core.ServiceHandler.GetMemberByNick(nick);
		}
		
		public List<GalleryPicture> GetMemberPic(string nick)
        {
#warning Function not async!
            return null; //Core.ServiceHandler.GetUserPics(nick);
		}
		
		public abstract void LoadMyUser();
	}
}
